<script>
  function verify(){
    var pass = document.forms["form"]["change_password"].value;
    var confirm = document.forms["myForm"]["confirm_password"].value;
    if((pass != confirm ) || (pass == '') || (confirm == '') ){
      alert("You must confirm your password correctly!");
      return false;
    }
    else{
      return true;
    }
  }
</script>

<div class="main-content grid_5 alpha">
  <header>
    <h2>Edit Admin Profile</h2>
  </header>

  <section>
    <?php echo $this->renderPartial('/partials/_notifications'); ?>

    <?php $form=$this->beginWidget('CActiveForm', array(
          'action' => bu('admin/admin/update'),
          'id' => 'form',
          'method' => 'post',
          'htmlOptions' => array(
              'name' => 'myForm',
              'class' => 'form',
              'novalidate' => 'true',
              'onSubmit' => 'javascript:return verify();',
              )
          ));
      ?>

			<fieldset>
        <legend>Change Password Field</legend>
        <label>Old Password <em>*</em></label>
        <?php echo $form->passwordField($admin, 'password', array('required' => 'required', 'value' => '')); ?>
        <?php echo $form->error($admin, "password"); ?>

        <label>Change Password <em>*</em></label>
        <input type="password" id="change_password" name="change_password" required="required" />

        <label>Confirm Password Change <em>*</em></label>
        <input type="password" id="confirm_password" name="confirm_password" required="required" />

        <div class="action">
						<button class="button button-gray" type="submit"><span class="accept"></span>OK</button>
						<button class="button button-gray" type="reset">Reset</button>
				</div>
      </fieldset>
    <?php $this->endWidget(); ?>
  </section>
</div>